package net.lab1024.sa.admin.module.business.category.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.admin.common.JsonTypeHandler;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;
import java.util.List;

@Data
@TableName("synthesis_record_detail")
public class RecordDetail {
    @Schema(description = "主键id")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "关联记录ID")
    private Long recordId;

    @Schema(description = "步骤序号")
    @Min(value = 1, message = "步骤序号必须大于0")
    private Integer step;

    @Schema(description = "步骤描述")
    @NotBlank(message = "步骤描述不能为空")
    private String description;

    @Schema(description = "反应物信息(JSON)")
    @TableField(typeHandler = JsonTypeHandler.class)
    private List<String> reactants;

    @Schema(description = "产物信息(JSON)")
    @TableField(typeHandler = JsonTypeHandler.class)
    private List<String> products;

    @Schema(description = "反应SMARTS")
    private String reactionSmarts;
}